# demo04_pickle.py
import pickle
list01 = [1, 1.23, True, "hehe"]

# 1. pickle.dump(数据,文件管家): 写
with open("/opt/test.data", mode="wb") as fw:
    pickle.dump(list01, fw)

# 2. pickle.load(文件管家): 读
with open("/opt/test.data", mode="rb") as fr:
    data = pickle.load(fr)
    print(data, type(data))